import pygame
from pygame.locals import *

import sys; sys.path.insert(0, "..")
import pygl2d
font = pygame.font.SysFont("Courier New", 12)

cacheText = {}
def getRenderText(text):
    if not text in cacheText.keys():
        rtext = pygl2d.font.RenderText(text, [255, 0, 0], font)
        cacheText[text] = rtext

    return cacheText[text]
